from rest_framework import serializers
from . import models


class MenuSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Menu
        fields = ['id', 'name', 'path', 'component', 'title', 'icon', 'ord', 'urls', 'method', 'is_route', 'is_menu',
                  'pid']

        extra_kwargs = {
            'id': {'read_only': True}
        }